#include <stdio.h>

int main(){
    int n;
    printf("Enter a prime number: ");
    scanf("%d",&n);
    long long result=1;
    int i=n;
    while(i>0){
        i/=10;
        result*=10;
    }
    result-=1;
    while(result%n!=0){
        result*=10;
        result+=9;
    }
    printf("%lld\n",result);
    return 0;
}
